<!--
 * @Author: 涵崽
 * @Date: 2023-12-06 17:50:27
 * @email: 1045654@qq.com
 * @gitee: https://gitee.com/han-zai
 * @LastEditors: 涵崽
 * @LastEditTime: 2023-12-06 17:50:31
 * @Description: 微信：1045654
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>多层卡片册</title>
    <link rel="stylesheet" href="./style.css" />
  </head>
  <body>
    <div class="container">
      <div class="item"><img src="./pic.jpeg" alt="" /></div>
      <div class="item"><img src="./pic.jpeg" alt="" /></div>
      <div class="item"><img src="./pic.jpeg" alt="" /></div>
      <div class="item"><img src="./pic.jpeg" alt="" /></div>
    </div>
    <script>
      const items = document.querySelectorAll(".item");
      items.forEach(dom => {
        dom.onclick = function () {
          dom.classList.toggle("active");
        };
      });
    </script>
  </body>
</html>
